#include <iostream>
#include <ctime>
using namespace std;

int main(){

    time_t now = time(0);
    char *dt = ctime(&now);
    cout << "本地日期和时间" << dt << endl;

    tm *gmtm = gmtime(&now);
    dt = asctime(gmtm);
    cout << "UTC 日期和时间：" << dt << endl;

    tm *ltm = localtime(&now);
    cout << "年：" << 1900 + ltm->tm_year << endl;
    cout << "月：" << 1 + ltm->tm_mon << endl;
    cout << "日：" << ltm->tm_mday << endl;
    cout << "时间：" << ltm->tm_hour<<":"<< ltm->tm_min <<":"<<ltm->tm_sec << endl;
    cout << "一年中的第几天：" << ltm->tm_yday << endl;
    cout << "一月中的第几天：" << ltm->tm_mday << endl;
    cout << "一周的第几天：" << ltm->tm_wday << endl;

    return 0;
}